#ifndef __EKF_INTR_H__
#define __EKF_INTR_H__

#include <global/header/trap.h>

/* The system level function prototype of irq interrupt handler */
typedef int(*ekf_irq_handler_f)(struct trapframe_s*);
/* and for exception handler */
typedef void(*ekf_ex_handler_f)(struct trapframe_s*);
/* syscall handler */
typedef void(*ekf_sys_handler_f)(uint32_t ret);

/* Set handler for responding interrupt */
void ekf_intr_ex_handler_set(uint32_t n, ekf_ex_handler_f h);
void ekf_intr_irq_handler_set(uint32_t irq, ekf_irq_handler_f h);
void ekf_intr_sys_handler_set(ekf_sys_handler_f h);

void ekf_intr_irq_eoi(int irq);

void ekf_intr_irq_line_enable(int irq);
void ekf_intr_irq_line_disable(int irq);

int  ekf_intr_timer_set(uint32_t freq);

int  ekf_intr_trap_from_user(struct trapframe_s *tf);

#endif
